package abstract1;

public class Cat extends Animal {
    private int age;//年龄
    public Cat(String name, int age) {
        super(name);
        this.age=age;
    }

    @Override
    public void bark() {
        System.out.println("喵喵！");
    }

    @Override
    public String toString() {
        return age+"岁的"+getName();
    }
}
